package com.kusen.springsource.empity;

import org.springframework.beans.factory.InitializingBean;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;

@Component
public class Cat implements InitializingBean {

	private String name;

	public String getName() {
		return name;
	}

	@Value("${JAVA_HOME}") //自动赋值功能
	public void setName(String name) {
		System.out.println("我被自动赋值了");
		this.name = name;
	}

	public Cat() {
		System.out.println("我被创建了");
	}

	@Override
	public void afterPropertiesSet() throws Exception {
		System.out.println("CatInitializingBean。。。组件自己实现的");
	}
}
